package servlet;

import impl.BaoDaoserviceImpl;
import pojo.AirQualityIndex;
import service.BaoDaoservice;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/dealServlet")
public class dealServlet  extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        AirQualityIndex air = new AirQualityIndex();
        BaoDaoservice aq =  new BaoDaoserviceImpl();
        System.out.println("进入删除");
        int id = Integer.parseInt(request.getParameter("id"));
        aq.del(id);
        response.sendRedirect("indexSelect");

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doPost(request,response);
    }
}
